<!doctype html>
<html>
  <head>
    <title>attribute mustaches</title>
    <script src="../../polymer.js"></script>
    <script src="../../tools/test/htmltest.js"></script>
    <script src="../../node_modules/chai/chai.js"></script>
  </head>
  <body>
    <x-test id="test"></x-test>

    <polymer-element name="x-target" attributes="src">
      <script>
        Polymer('x-target', {
          // force an mdv binding
          createBinding: function() {
            return Element.prototype.createBinding.apply(this, arguments);
          },
          inserted: function() {
            this.testSrcForMustache();
          },
          attributeChanged: function(name, oldValue) {
            this.testSrcForMustache();
            if (this.getAttribute(name) === '../testSource') {
              done();
            }
          },
          testSrcForMustache: function() {
            chai.assert.notMatch(this.getAttribute('src'), Polymer.bindPattern,
              'attribute does not contain {{...}}');
          }
        });
      </script>
    </polymer-element>

    <polymer-element name="x-test">
      <template>
        <x-target id="target" src="../{{src}}"></x-target>
      </template>
      <script>
        Polymer('x-test', {
          src: 'testSource'
        });
      </script>
    </polymer-element>
  </body>
</html>
